package com.imooc.service;

import java.util.ArrayList;
import java.util.List;

import com.imooc.dao.MessageDao;

/**
 * 维护
 * @author 95577
 *
 */
public class MaintainService {
	/**
	 * 单条删除
	 * @param id
	 */
	public void deleteOne(String id) {
		MessageDao messageDao = new MessageDao();
		if (id != null && !"".equals(id)) {
			messageDao.deleteOne(Integer.valueOf(id));
		}
	}
	/**
	 * 多条删除
	 * @param idList
	 */
	public void deleteBatch(String[] idList) {
		MessageDao messageDao = new MessageDao();
		List<Integer> idListInteger = new ArrayList<Integer>();
		for (String id : idList) {
			idListInteger.add(Integer.valueOf(id));
		}
		messageDao.deleteBatch(idListInteger);
	}
}
